package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.List;

/**
 * 公民实体类
 */
@TableName("t_man")
public class ManBean {
    /**编号*/
    @TableId(value = "pk_manId",type = IdType.AUTO)
    private Integer id;
    /**姓名*/
    @TableField("m_name")
    private String name;
    /**电话*/
    @TableField("m_phone")
    private String phone;
    /**公民数量*/
    //如果属性没有映射一个列，需要加上@TableField(exist = false)
    @TableField(exist = false)
    private Integer carNum;
    /**汽车集合*/
    @TableField(exist = false)
    private List<CarBean> carList;

    public ManBean(String name, String phone) {
        this.name = name;
        this.phone = phone;
    }

    public ManBean() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getCarNum() {
        return carNum;
    }

    public void setCarNum(Integer carNum) {
        this.carNum = carNum;
    }

    public List<CarBean> getCarList() {
        return carList;
    }

    public void setCarList(List<CarBean> carList) {
        this.carList = carList;
    }

    @Override
    public String toString() {
        return "ManBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                ", carNum=" + carNum +
                ", carList=" + carList +
                "\n";
    }
}
